Skip to content

CPU Arch now lives under host.cpu #2374 #2376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thompson-tomo
Copy link
Contributor

Fixes #2374

Changes

This moves the CPU arch to now be under the host.cpu namespace rather than directly under the host namespace

Note: if the PR is touching an area that is not listed in the existing areas, or the area does not have sufficient domain experts coverage, the PR might be tagged as experts needed and move slowly until experts are identified.

Merge requirement checklist

@thompson-tomo thompson-tomo requested review from a team as code owners June 16, 2025 02:52
@thompson-tomo thompson-tomo force-pushed the feature/#2374_MoveArchUnderCPU branch from a6537ce to 52ca36e Compare June 16, 2025 02:53
@thompson-tomo thompson-tomo changed the title #2374 CPU Arch now lives under host.cpu CPU Arch now lives under host.cpu #2374 Jun 16, 2025
Copy link
Contributor

@braydonk braydonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favour of this. We should note that this will probably break some existing resource detectors, namely the one in the Collector (but it will likely need a few changes to come along with other semconv changes we made so I think it's okay).

Copy link
Contributor

@rogercoll rogercoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am in favor of moving the arch within the cpu namespace, but what is the difference between the host.cpu.* attributes and cpu.* ones? https://github.com/open-telemetry/semantic-conventions/blob/main/model/cpu/registry.yaml#L4 Should the host.cpu.* attributes only be part of system.* metrics?

Should we align these two groups?

@braydonk
Copy link
Contributor

At the moment, the host.cpu attributes are about CPUs attached to the host, but I do like the idea of all of these just being under cpu rather than having cpu and host.cpu.

I'll tag in @jsuereth and @dmitryax to answer this question from the entities perspective. host.cpu attributes are not identifying for the host, so they'd probably be considered descriptive attributes. Would it be okay for the host entity to have descriptive attributes that came from a different root namespace, or is it important that any attributes on an entity (even descriptive ones) share a root namespace?

@thompson-tomo
Copy link
Contributor Author

thompson-tomo commented Jun 16, 2025

I was actually think about doing that but decided against it as hopefully entity relationships will help that scenario. What about if a message was added on the cpu.* namespace stating something similar to geo in relation to nesting it.

I would like to eventually see the scenario where both a device & the host could have cpu objects especially in virtualised environments which is where the cpu entity would come in hence difficult to put it at the root.

@thompson-tomo thompson-tomo force-pushed the feature/#2374_MoveArchUnderCPU branch 2 times, most recently from 065147b to 41a3f3e Compare June 19, 2025 01:21
@thompson-tomo
Copy link
Contributor Author

thompson-tomo commented Jun 26, 2025

So I have been thinking about this some more especially when trying to improve the brief on the page. While also thinking about how a consistent experience can be offered to users of otel and avoid duplication.

What your thought about moving host.cpu* & cpu.* attributes to be in the hw.cpu.* namespace while also taking advantage of #2417 to avoid duplication? I note cpu is already defined as a value for hw.type.

This would mean that the hardware namespace is where all fixed hardware properties are described.

If you are on board @braydonk / @rogercoll I can make those changes tomorrow.

@thompson-tomo thompson-tomo force-pushed the feature/#2374_MoveArchUnderCPU branch 3 times, most recently from 62d43ea to 695b73c Compare July 7, 2025 05:27
@rogercoll
Copy link
Contributor

I think that even this attribute is still not used in system or k8s metrics, it could potentially be. That would be the same case as cpu.mode.

What your thought about moving host.cpu* & cpu.* attributes to be in the hw.cpu.* namespace while also taking advantage of #2417 to avoid duplication? I note cpu is already defined as a value for hw.type.

Although the cpu hw.type is already defined, I find the hw. namespace for cpu attributes redundant. hw. implies a meaningful distinction between hardware and software representations of architecture, but in practice, cpu.arch reflects the effective architecture seen by the process/pod/host —whether real, virtualized, or emulated—making the prefix unnecessary. (not a strong opinion though)

@thompson-tomo
Copy link
Contributor Author

Agree we have a couple of scenarios for using the value of host.arch And it could be used more.

I think it would be beneficial to have 2 distinct attributes:

  • hw.cpu.arch/hw.processor.arch to describe what sw is running. It would be great to distinguish between physical and virtual hw but that is seperate issue
  • app.arch to describe the architecture it has been built for

Ideally eventually we could use a shared enum between them.

@thompson-tomo thompson-tomo force-pushed the feature/#2374_MoveArchUnderCPU branch 2 times, most recently from 23fc439 to 55d5aa3 Compare July 15, 2025 08:59
@jsuereth
Copy link
Contributor

@braydonk - Can you get the @open-telemetry/semconv-system-approvers group to make a decision on this here?
Regarding cpu vs host.cpu namespace, according to our new namespacing rules, cpu is reaosnably unique and this could live in cpu. I defer to System semconv SIG for decision on what they want here.

@thompson-tomo
Copy link
Contributor Author

Don't forget we also have the hw.cpu.* namespace.

@thompson-tomo thompson-tomo force-pushed the feature/#2374_MoveArchUnderCPU branch from 55d5aa3 to 60954b0 Compare August 1, 2025 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Move host.arch to be under host.cpu.arch
4 participants